import * as icons from '@ant-design/icons-vue'
import type {App} from "vue"
import 'ant-design-vue/dist/antd.css'
import Antd, {message,} from 'ant-design-vue'

export default {
    install: (app: App): void => {

        //注册全量图标
        Object.entries(icons).forEach(it => app.component(it[0], it[1]));

        //按需注册组件
        // app.component(Button.name, Button)

        //注册全量组件
        app.use(Antd)

        //options api 使用 this.message
        app.config.globalProperties.message = message

        //provide 供 composition api 使用
        app.provide('message', app.config.globalProperties.message)

    }
}
